<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="activiti:approvalLeave:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('activiti:approvalLeave:edit')}]];
        var removeFlag = [[${@permission.hasPermi('activiti:approvalLeave:remove')}]];
        var prefix = ctx + "activiti/approvalLeave";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "请假审批",
		        showExport: true,
                columns: [{
    		        checkbox: true
    		     },
				{
					field : 'taskId', 
					title : '任务ID',
					sortable: true
				},
				{
					field : 'createBy', 
					title : '操作人',
					sortable: true
				},
				{
					field : 'auditResult', 
					title : '审批结果',
					sortable: true,
					formatter: function(value, row, index) {
						if (value == "1") {
		                    return '<span class="badge badge-primary">通过</span>';
		                } else if (value == "0") {
		                    return '<span class="badge badge-danger">不通过</span>';
		                }
		            }
				},
				{
					field : 'comment', 
					title : '审批意见',
					sortable: true
				},
				{
					field : 'auditTime', 
					title : '审批日期',
					sortable: true
				},
		        ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>